import React, { Component } from 'react';

const ThemeContext = React.createContext();

class Header extends Component {

  render() {
    return (
      <ThemeContext.Consumer>
        {
          (context) => (
            <h2 style={{background: context.background}}>{this.props.title}</h2>
          )
        }
      </ThemeContext.Consumer>
    );
  }

}

export default Header;
